
#include <atomic>
#include <cstdint>
// #include "../src/gPTP/ptp.h"
struct TSNCONF {
    char entity[30];
    char content[20];
};

struct CI {
    char clockIdentity[8];
};

struct PortID {
    CI ci[8];
    char content[8];
    int ci_num;
    char tag[20];
};

struct Tunnel {
    std::atomic<int> tag;
    int error;  // xml请求层、操作层是否符合规范
    char mes[20];  // 消息层(rpc、rpc_reply、notification)
    char m_id[20]; // 消息的序号
    char op[20];   // 操作层，若无则null(get、get-bulk、edit、edit-bulk)
    TSNCONF TC[20];
    int TC_num;
    PortID PI;
};

struct PortIdentity {
    uint8_t clockIdentity[8];
    int portNumber;
};

struct TSNConfig {
    int device_id;
    int gm_flag;
    int port_num;
    int master_port;
    int slave_port;
    int link_delay_measure_period;
    int sync_period;
    int domain_number;
    PortIdentity port_identity;
    int mean_link_delay_thrld;
};

void write_TSNConfig(TSNConfig *tsnconfig, Tunnel *tunnel);
